package com.example.hibernate.e.inheritance_1;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="T_BANKACCOUNT")
@AttributeOverride(name="owner", column=@Column(name="BA_OWNER", nullable=false))
@SequenceGenerator(name="SEQ_BANKACCOUNT", sequenceName="SEQ_BANKACCOUNT", initialValue=1)
public class BankAccount extends BillingDetails {
	
	@Id
	@GeneratedValue(generator="SEQ_BANKACCOUNT")
	@Column(name="BANKACCOUNT_ID")
	private Long id;
	
	@Column(name="BANKACCOUNT_ACCOUNT")
	private String account;
	
	@Column(name="BANKACCOUNT_BANKNAME")
	private String bankname;
	
	@Column(name="BANKACCOUNT_SWITT")
	private String switt;
	
	public Long getId() {
		return id;
	}
	private void setId(Long id) {
		this.id = id;
	}
	public String getAccount() {
		return account;
	}
	public void setAccount(String account) {
		this.account = account;
	}
	public String getBankname() {
		return bankname;
	}
	public void setBankname(String bankname) {
		this.bankname = bankname;
	}
	public String getSwitt() {
		return switt;
	}
	public void setSwitt(String switt) {
		this.switt = switt;
	}
	@Override
	public String toString() {
		return "BankAccount [id=" + id + ", account=" + account + ", bankname=" + bankname + ", switt=" + switt + "]";
	}
}
